﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace Tomahawk.Runtime.Console.Commands
{
    public class ViewModeCommand : ConsoleCommand
    {
        public override string GetName()
        {
            return "viewmode";
        }

        public override string GetHelp()
        {
            return "Usage: viewmode mode.\nValid Modes: Solid (default), Wireframe, Point";
        }

        public override string Execute(string[] parameters)
        {
            FillMode mode = FillMode.Solid;
            if (parameters.Count() > 1)
            {
                string param = parameters[1];
                if (string.Compare(param, "WIREFRAME", true) == 0)
                {
                    mode = FillMode.WireFrame;
                }
                else if (string.Compare(param, "POINT", true) == 0)
                {
                    mode = FillMode.Point;
                }
            }

            Engine.Instance.GraphicsDevice.RenderState.FillMode = mode;

            return "View mode changed to " + mode.ToString();
        }
    }
}
